package com.itheima.Logback;
import lombok.extern.log4j.Log4j;
import lombok.extern.log4j.Log4j2;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;




public class Test {
    //在需要日志记录的类中，定义记录日志的对象：

    static Logger log = (Logger) LoggerFactory.getLogger(Test.class);

    public static void main(String[] args) {
        //目标：掌握日志框架Logback的基本使用
        //字符串拼接
        String name = "张三";
        int age = 18;
        log.info("用户信息：{},{}",name,age);




        try {
           log.info("除法操作开始。。。");
            chu(10,0);
            log.info("除法操作结束。。。");
        } catch (Exception e) {
           log.error("除法操作出现异常。。。");
          //  throw new RuntimeException(e);
        }

    }
    public static void chu(int a,int b){
            log.info("\t除法参数："+a);
            log.info("\t除法参数："+b);
            int c = a/b;
            log.info("\t除法结果："+c);



    }
}
